	function gfrcalc(unitchoice,sex,age,weight,creatinine){

	
	var gfr=0;
	var constant=1.23;
	
//convert US to SI
if (!unitchoice){
weight=weight/2.20462262185;
creatinine=creatinine*88.402;
}	
	
	
// Cockcroft  formula
// gfr = [(140-age)xweightxC]/creatinine C= 1.23 men, 1.04 women

if (sex==0) 
{
constant = 1.04;
}

gfr=((140-age)*weight*constant)/creatinine; 

//round to 2 dec places
//gfr=Math.round(gfr*100)/100;
gfr=Math.round(gfr);
weight=Math.round(weight);
creatinine=Math.round(creatinine);			


return {
			 gfr:gfr,
			 weight:weight,
			 age:age,
			 creatinine:creatinine
	};		 
}




function ref(){
// display reference
 return "Cockroft D. Gault MH. Nephron. 1976; 16:13-41";

}